<%@ Page Language="VB" AutoEventWireup="false" CodeFile="SQServerE.aspx.vb" Inherits="ServerE" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">    
    <title>Untitled Page</title>
 
    <link href="ADStyles.css" rel="stylesheet" type="text/css" />

    </head>
    
<script type="text/javascript" language="javascript">
function setToolbarAction(varAction)
{
    var oAction=document.getElementById("hidToolbarAction");
    oAction.value=varAction;

    return true;
}

function RefreshServerList()
{
    var TopWindow=top.window.document;
    var DashFrame=TopWindow.getElementById('Menu');
    DashFrame.src='SQServerL.aspx';
    
    var Refresh=document.getElementById('hidRefreshParent');
    Refresh.value='no';
    
    return true;
}

function ClearServer()
{
    var TopWindow=top.window.document;
    var RServer=TopWindow.getElementById('SID');
    
    RServer.value='';
    
    RefreshServerList();
    setToolbarAction('del');
    
    return true;
}

function onLoad()
{
    var TopWindow=top.window.document;
        
    var DashTitle=TopWindow.getElementById('DashboardTitle');
    var DashMode=TopWindow.getElementById('DMode');
    
    var RServer=TopWindow.getElementById('SID');
    var LServer=document.getElementById('SID');
    
    DashTitle.innerHTML='<%=me.FormLabel %>';
    DashMode.value='<%=me.EditMode %>';
    
    if (RServer.value>'' && LServer.value=='')
    {
        LServer.value=RServer.value;
        document.form1.submit();
    }
    else
    {           
        RServer.value=LServer.value;
    }
    
    var RefreshParent=document.getElementById('hidRefreshParent');
    if (RefreshParent.value='yes')
        RefreshServerList();
}
</script>

<body onload="onLoad();">
    <form id="form1" runat="server">
    <div>
        <input type="hidden" id="SID" runat="server" />
        
        <table style="width: 510px; height:470px; border: solid 1px black; border-collapse:collapse;">
        <tr>
            <td style="vertical-align:top; text-align:left; height:25px;">
            
                <table width="100%" style="border-collapse:collapse;">
                    <tr class="wmObjectDetailDev_TH" style="height: 30px; border-collapse: collapse; background-color: #C3C4C1; border-bottom: solid 1px black;">
                        <td style="width:300px; font-weight: bold; padding-left: 5px;">SQLAutoDoc Add/Edit Server</td>
                        <td style="width:25px;">                
                            <input type="image"
                                src="images/tb_del.jpg"
                                title="Delete Server Info"
                                id="cmdRemove"
                                name="cmdRemove"
                                value="Remove Server"
                                onclick="ClearServer();"/>
                        </td>
                        <td style="width:25px;">
                            <input type="image"
                                    src="images/tb_save.jpg"
                                    title="Update Server Info"
                                    id="cmdUpdate"
                                    name="cmdUpdate"
                                    value="Update Server Info"
                                    onclick="setToolbarAction('save');"/>
                        </td>
                        <td style="width:25px;">                
                            <input type="image"
                                src="images/tb_add.jpg"
                                title="Add New Database"
                                id="cmdAddDatabase"
                                name="cmdAddDatabase"
                                value="Add New Database"
                                onclick="setToolbarAction('newdb');"/>
                        </td>
                        <td style="width:150px;"></td>
                        <td></td>
                    </tr>
                </table>
                
            </td>
        </tr>
        
        <tr>
            <td style="vertical-align:top; text-align:left; height: 60px;">

            <table>
                <tr>
                    <td>Server Name:</td>
                    <td>
                        <asp:TextBox ID="txtName" runat="server"></asp:TextBox> (SERVER, SERVER\INSTANCENAME or IP Address)
                        <div id="errName" visible="false" class="wmErrorMessage" runat="server">No Error</div>
                    </td>
                </tr>
                                
                <tr>
                    <td>Description:</td>
                    <td>
                        <asp:TextBox ID="txtDesc" runat="server" Width="400px"></asp:TextBox>
                        <div id="errDesc" visible="false" class="wmErrorMessage" runat="server">No Error</div>
                    </td>
                </tr>
                
                <tr>
                    <td>Is Active:</td>
                    <td>
                        <asp:checkbox ID="chkIsActive" runat="server" Checked></asp:checkbox>
                        <div id="errIsActive" visible="false" class="wmErrorMessage" runat="server">No Error</div>
                    </td>
                </tr>    
            </table>
            </td>
        </tr>
        
        <tr>
            <td colspan="2" style="height: 425px;">
                &nbsp;
            </td>
        </tr>
    </table>
    
    </div>
    
    <input type="hidden" id="hidRefreshParent" value="no" runat="server" />
    <input type="Hidden" id="hidToolbarAction" value="" runat="server" />
    </form>
</body>
</html>
